
<%@ page import="com.blb.common.utils.CookieUtil" %><%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2022/11/24
  Time: 14:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"  isELIgnored="false" %>
<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="https://cdn.jsdelivr.cn/npm/@bootcss/v3.bootcss.com@1.0.51/favicon.ico">
    <link rel="canonical" href="https://getbootstrap.com/docs/3.4/examples/signin/">
    <title>系统登录</title>
    <base href="${pageContext.request.scheme }://${pageContext.request.serverName }:${pageContext.request.serverPort }${pageContext.request.contextPath }/ "/>
    <!-- Bootstrap -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script src="https://cdn.jsdelivr.cn/npm/jquery@1.12.4/dist/jquery.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
    <!-- Custom styles for this template -->
    <link href="css/signin.css" rel="stylesheet">
</head>

<body>
<%
    String username = CookieUtil.readCookie(request, "username");
    String password = CookieUtil.readCookie(request, "password");

    pageContext.setAttribute("username",username);
    pageContext.setAttribute("password",password);
%>
<div class="container">
    <form class="form-signin" action="user.do?m=login" method="post">
        <h2 class="form-signin-heading">在线考试系统登录</h2>
        <label for="inputUsername" class="sr-only">账号</label>
        <input type="text" id="inputUsername" name="username" class="form-control" placeholder="请输入账号" value="${username}" required autofocus>
        <label for="inputPassword" class="sr-only">密码</label>
        <input type="password" name="password" id="inputPassword" class="form-control" placeholder="请输入密码" value="${password}" required>
        <label for="inputCode" class="sr-only">验证码</label>
        <input type="text" id="inputCode" name="code" class="form-control" placeholder="请输入验证"required>
        <img src="code.do" id="code" onclick="changeCode()"><br>
        <div class="checkbox">
            <label>
                <input type="checkbox" name="rememberMe"> 七天免登录
            </label>
        </div>
        <button class="btn btn-lg btn-primary btn-block" type="submit">登录</button>
        <a href="register.jsp">用户注册</a>
    </form>
    <script>
        function changeCode() {
            document.getElementById("code").src = "code.do?x="+Math.random();
        }
    </script>
</div> <!-- /container -->
</body>
</html>
